<div style="padding-left:3px;padding-top:10px;">
    <h3><%=@story.title%></h3>
</div>
<div class="story-component-box-mobile" style="padding:5px;">
    <%= Random.paragraphs%>
</div>
<div style="float:right; margin:3px;">
    <h7 style="color:#3a87ad"><%= Share.find_all_by_story_id(@story.id).length%> shares</h7>

    <h7 style="color:#468847"><%= Likedislike.find_all_by_story_id_and_action(@story.id,1).length%> Ups</h7>

    <h7 style="color:#b94a48"><%= Likedislike.find_all_by_story_id_and_action(@story.id,2).length%> Downs</h7>
</div>
<br>
<div style="padding-left:3px;float:left;">
    <h4> Comments </h4>
</div>
<br>
<br>
<div style="width:95%;">
    <% comments = Comment.find_all_by_story_id(@story.id) %>
    <% comments.each do |comment| %>

    <div class="story-comment-box-mobile well" style="float:left;clear:both;width:90%;margin:0.5%">
        <h5 style="padding-left:3%;padding-top:1px;">    <%= comment.user.name %> says:</h5>
        <div style="clear:both;padding:1px;">
            <a href="#" style="float:left;padding-right:5px;padding-left:3px;padding-top:10px;" align="top"> <img
                    src="http://placehold.it/50x50">
            </a>
            <div style="padding-top:10px;padding-bottom:5px;">
                <%= comment.content %>
            </div>
        </div>
        <ul class="nav">
            <% pic = nil %>
            <% if comment.downed_by_user?(current_user) then%>
                <% pic = "http://img825.imageshack.us/img825/7254/undislike.png" %>
            <% else %>
                <% pic = "http://img717.imageshack.us/img717/856/dislikekh.png" %>
            <% end %>
            <li><%= link_to (image_tag (pic)) ,{:action=> :down_comment, :user_id => params[:id2], :comment_id => comment.id}, {:style =>'float:right;margin-right:4%;width:30px;height:30px;'} %>
            </li>
            <li>
                <h8 style="color:#b94a48;float:right;margin-right:1%;padding-top:2px;"> <%= comment.get_num_downs %>
                </h8>
            </li>
            <% pic2 = nil %>
            <% if comment.upped_by_user?(current_user) then%>
                <% pic2 = "http://img585.imageshack.us/img585/9320/unlikec.png" %>
            <% else %>
                <% pic2 = "http://img210.imageshack.us/img210/5599/likecopy.png" %>
            <% end %>
            <li><%= link_to (image_tag (pic2)) ,{:action=> :up_comment, :user_id => params[:id2], :comment_id => comment.id}, {:style =>'float:right;margin-right:1%;width:30px;height:30px;padding-bottom:5px;'} %>
            </li>
            <li>
                <h8 style="color:#468847;float:right;margin-right:1%;"> <%= comment.get_num_ups %>
                </h8>
            </li>
        </ul>
    </div>
<% end %>
</div>
<div style="width:95%">
    <%= form_for(@comment) do |f| %>
    <div class="story-comment-box-mobile well" style="padding-left:3px; clear:both;width:margin:0.5%">
        <div style="margin-left:0.5%;">
            Enter a comment:
        </div>
        <%= f.text_area :content, :class => "story-textarea-mobile" %>
    </div>
    <%= f.hidden_field :user_id, :value => @user.id %>
    <%= f.hidden_field :story_id, :value => @story.id %>
    <div class="actions" style="padding:20px;float:right;">
        <%= f.submit "comment" ,:class => "btn btn-large" %>
        <% end %>
    </div>
</div>